home *** CD-ROM | disk | FTP | other *** search
/ Mission to McDonaldLand / Mission To McDonaldLand.iso / calnz.dxr / 00017_Script_nuker < prev    next >
Text File  |  1998-10-25  |  1KB  |  61 lines

  1. property NukeStatus,nukelist,callback,DT
  2.  
  3. on birth me
  4.   
  5.   set nukeStatus = FALSE
  6.   set callBAck = VOID
  7.   set nukeList = []
  8.   set DT = 0
  9.   append(the actorlist,me)
  10.   return me
  11. end
  12.  
  13. On nukeObj me,NukeThis,CallBackP
  14.   set callBack = callBackP
  15.   append(nukeList,NukeThis)
  16.   set nukeStatus = TRUE
  17. end
  18.  
  19. on nukeAll me,Objs,callBackP,delayTimeP
  20.   set callBack = callBackP  
  21.   set DT = the ticks + delayTimeP
  22.   set total = count(the objectList of objs)
  23.   if total>0 then
  24.     repeat with i = 1 to total
  25.       
  26.       if  (count(the objectList of objs) > 1) then
  27.         set objToDel = getat(the objectList of objs ,2)
  28.         NukeObj(me,objToDel,CallBAck)
  29.         deleteat (the objectList  of objs,2)
  30.       else
  31.         set ObjToDel = getat(the objectList of objs,1)
  32.         NukeObj(me,objToDel,CallBack)
  33.         deleteat (the objectList  of objs,1)
  34.       end if
  35.     end repeat
  36.   end if
  37. end 
  38.  
  39.  
  40.  
  41. on Stepframe me
  42.   if NukeStatus then
  43.     put the ticks &&DT
  44.     if (the ticks) >= DT then
  45.       repeat with killObj in nukeList
  46.         kill(killObj)
  47.       end repeat
  48.       set nukeStatus = FALSE
  49.       set nukeList = []
  50.       if voidP(callBack) = FALSE then
  51.         do callback
  52.       end if
  53.     end if
  54.   end if
  55.   
  56. end
  57.  
  58. on kill me
  59.   delfromactorlist(me)
  60. end
  61.